<!--<?php print <<<EOT
-->
<link rel="stylesheet" href="$pwModeImg/style.css?{$GLOBALS['wind_repair']}" />
<link rel="stylesheet" href="mode/cms/david.css" />
<script type="text/javascript"     src="http://maps.googleapis.com/maps/api/js?sensor=false"> </script>
<script type="text/javascript">
  var directionDisplay;
  var directionsService = new google.maps.DirectionsService();
  var map;
  var marker;
  var latlng = new google.maps.LatLng(43.82206, -79.298592);   
  function initialize() { 
  	  directionsDisplay = new google.maps.DirectionsRenderer();       
	  var myOptions = {       
		  zoom: 14,       
		  center: latlng,       
		  mapTypeId: google.maps.MapTypeId.ROADMAP     
	  };     
	  map = new google.maps.Map(document.getElementById("map_canvas"),myOptions); 
	  directionsDisplay.setMap(map);
	  marker = new google.maps.Marker({
      map:map,
      draggable:true,
      animation: google.maps.Animation.DROP,
      position: latlng
    });
    google.maps.event.addListener(marker, 'click', toggleBounce);  
  }
 
  function toggleBounce() {
 
    if (marker.getAnimation() != null) {
      marker.setAnimation(null);
    } else {
      marker.setAnimation(google.maps.Animation.BOUNCE);
    }
  }

  function calcRoute() {
    //var start = document.getElementById("start").value;
    var end = document.getElementById("end").value;
    var request = {
        origin:latlng, 
        destination:end,
        travelMode: google.maps.DirectionsTravelMode.DRIVING
    };
    directionsService.route(request, function(response, status) {
      if (status == google.maps.DirectionsStatus.OK) {
        directionsDisplay.setDirections(response);
      }
    });
  }

</script>

<style type="text/css">
.cmsForumlist{padding:7px;}
.cmsForumlist li{height:30px;}
.cmsForumlist li a{display:block;border:1px solid $tdcolor;background:$forumcolorone;margin:3px;line-height:22px;height:22px;overflow:hidden;}
.cmsForumlist li a:hover,.cmsForumlist .current a{border:1px solid $tablecolor; font-weight:700;background:$forumcolortwo; text-decoration:none;}
</style>
<div id="breadCrumb">
<!--
EOT;
if(checkEditPurview($windid,$articleModule->columnId)){
print <<<EOT
-->
	<a href="{$cmsBaseUrl}q=post&cid={$articleModule->columnId}" class="s2 b fr" target="_blank">[发表文章]</a>
	<!--span class="bts fr pr"><span><button type="button" onClick="location.href='{$cmsBaseUrl}q=post&cid={$articleModule->columnId}';">发表文章</button></span></span-->
<!--
EOT;
} if (!checkEditPurview($windid,$articleModule->columnId) && getPostPurview($windid,$_G)){
print <<<EOT
-->
	<a href="{$cmsBaseUrl}q=post&cid={$articleModule->columnId}" class="s2 b fr" target="_blank">[我要投稿]</a>
	<!--span class="bts fr pr"><span><button type="button" onClick="location.href='{$cmsBaseUrl}q=post&cid={$articleModule->columnId}';">我要投稿</button></span></span-->
<!--
EOT;
} 
$articleModule->subject  = S::htmlEscape($articleModule->subject);
print <<<EOT
-->
	<img align="absmiddle" src="images/wind/thread/home.gif" alt="forumlist" class="breadHome" /><em class="breadEm"></em>$pagePosition
</div>
<div class="cms_main cc">
	<div class="cms_cm">
		<div class="cms_cw">
			<div class="t">
				<table width="100%" style="table-layout:fixed;"><tr><td class="vt" height="400" style="padding:20px;">
				<div class="mb10"><span>>> 在线菜单</span><h1 class="tac f24 b" style="font-family:Arial,Microsoft Yahei,Simsun;">{$articleModule->subject}</h1></div>
				<div class="cmsTips tac mb20">
<!--
EOT;
if($articleModule->user){
print <<<EOT
-->
					<span class="mr10">作者：<a href="{$db_userurl}{$articleModule->userId}" target="_blank">{$articleModule->user}</a></span>
                    <div id="david">{$map}</div>
<!--
EOT;
}if($articleModule->author){
print <<<EOT
-->					
					<span class="mr10">原创作者：{$articleModule->author}</span>
<!--
EOT;
}if(isURL($articleModule->fromUrl)){
print <<<EOT
-->					
					<span class="mr10">来源：<a href="{$articleModule->fromUrl}" target="_blank">{$articleModule->fromInfo}</a></span>
<!--
EOT;
}elseif($articleModule->fromInfo){print <<<EOT
-->
					<span class="mr10">来源：{$articleModule->fromInfo}</span>
<!--
EOT;
}print <<<EOT
-->
					<span class="mr10 f10">$postdate</span>
<!--
EOT;
if (checkEditPurview($windid,$articleModule->columnId)  || $articleModule->userId == $winduid) {
print <<<EOT
-->					
					<a href="{$basename}q=post&action=edit&id=$id&page=$page" class="mr5">[编辑]</a>
<!--
EOT;
}if(checkEditPurview($windid,$articleModule->columnId)){print <<<EOT
-->
					<a href="javascript:;" onclick="deleteArticle('$id','$articleModule->columnId');return false;">[删除]</a>
<!--
EOT;
}print <<<EOT
-->
				</div>
				<div class="summary mb10">
				{$articleModule->descrip}
				</div>
				<div class="cmsContent" id="cmsContent">
					{$content}
				</div>
				<!--<div class="mb20">关键词：<a href="#" class="mr10 s2">汽车</a><a href="#" class="mr10 s2">宝马</a><a href="#" class="mr10 s2">北京车展</a></div>-->
			</td></tr>
			<tr><td class="vt" style="padding:20px;">
				<div class="cc mb20">$pages</div>
			</td></tr>
			</table>
			<div class="p20 cc">
				<div class="cmsTips mb10">
					<div class="fr">
						<a href="apps.php?q=collection&a=favor&type=cms&ajax=1&id=$id" class="mr20 allCollect" onclick="return ajaxurl(this);">收藏</a><a href="javascript:;" onclick="sendmsg('operate.php?action=toweibo&ajax=1&type=cms&id=$id','',this.id);" class="allForward">新鲜事</a>
					</div>
					<span class="mr10">已有<span class="s2">{$articleModule->hits}</span>人阅读</span>
<!--
EOT;
if ($sourceUrl) {print <<<EOT
-->	
					<a href="$sourceUrl">看看大家怎么评论&gt;&gt;</a>
<!--
EOT;
}print <<<EOT
-->
				</div>
<!--
EOT;
if ($articleModule->relate) {print <<<EOT
-->	
				<div class="reReading mb10">
					<h2 class="f14 b">相关阅读</h2>
					<div class="cmsListA cmsIconA">
						<ul>
<!--
EOT;
foreach ($articleModule->relate as $value) {print <<<EOT
-->	
							<li><a href="$value[url]" target="_blank">$value[subject]</a></li>
<!--
EOT;
}print <<<EOT
-->
						</ul>
					</div>
				</div>
<!--
EOT;
}print <<<EOT
-->

<!--
EOT;
if ($sourceUrl) {
print <<<EOT
-->	
				<div class="gotoForum tac f14 b mb10">
					<a href="$sourceUrl" target="_blank">进入{$articleModule->fromInfo}讨论</a>
				</div>
<!--
EOT;
}if (checkReplyPurview()) {
print <<<EOT
-->					
			<form method="post" id="mainForm" name="FORM" onsubmit="addcmscomment(document.FORM)" action="pw_ajax.php?action=cmsreply&type=addcomment" >
			<input type="hidden" name="article_id" value="{$id}">
			<div class="mb10">
<!--
EOT;
require_once PrintEot('wysiwyg_editor_cmsreply');
print <<<EOT
-->
			</div>
			<div class="mb20">
				<span class="btn" style="margin:0;" id="cmsSubmitWrap"><span><button id="cmsSubmit" type="submit" >评论</button></span></span>
				<span id="cmsSubmitLoading" style="display:none;">处理中...</span>
			</div>	
			</form>
<script type="text/javascript">
onReady(function(){
	//fix firefox
	getObj("cmsSubmit").disabled=false;
})
function addcmscomment(form){
	var e=getEvent();
	if(e.preventDefault){
		e.preventDefault();	
	}else{
		e.returnValue=false;	
	}
	getObj("cmsSubmit").disabled=true;
	var atc_content = editor.getUBB();
	if(atc_content.replace(/\s*/g,'') == ''){
		showDialog("error","内容不能为空!","","","");
		getObj("cmsSubmit").disabled=false;
		return false;
	}else{
		getObj("cmsSubmitWrap").style.display="none";
		getObj("cmsSubmitLoading").style.display="block";
		ajax.submit(form, function() {
			getObj("cmsSubmit").disabled=false;
			var gotText = ajax.request.responseText;
			if ('success' == gotText) {
				location.reload();
			} else {
				getObj("cmsSubmitWrap").style.display="inline-block";
				getObj("cmsSubmitLoading").style.display="none";
				ajax.guide();
			}
			
		})
		return false;
	}
}
function addReply(form){
	var content = form.content.value;
	if(content==''){
		showDialog("error","内容不能为空!",2);
		return false;
	}
	ajax.submit(form, function() {
		var gotText = ajax.request.responseText;
		if ('success' == gotText) {
			var commentnum = getObj('commentnum_'+form.commentid.value);
			if(commentnum){
				var regExp = /\(([0-9]+)\)/;
				if(regExp.test(commentnum.innerHTML)){
					var num = RegExp.$1;
				}
				if(isNaN(num)){
					str = '(1)';
				}else{
					str = '('+(++num)+')';
				}
				commentnum.innerHTML = str;
			}
			statusObj = 0;
			getReplyList(form.commentid.value);
			form.content.value = '';
		} else {
			ajax.guide();
		}
	})
	return false;
}
</script>
<!--
EOT;
} if ($cmsReplyList) {
	require_once PrintEot('cmsreply');
	}
print <<<EOT
-->
<script>
function delcmscomment(commentid){
	ajax.send('pw_ajax.php?action=cmsreply&type=delcomment','commentid='+commentid,function(){
		var rText = ajax.request.responseText;
		if (rText=='success') {
			delElement('comment_'+commentid);
		} else {
			ajax.guide();
		}
	});
}

function getCommentList(href){
	ajax.send(href,'',function(){
		getObj('listcomments').innerHTML = ajax.runscript(ajax.request.responseText);
	});
	scroll(0,0);
	return false;
}

if (typeof statusObj == 'undefined') var statusObj = 0;
function getReplyList(commentid){
	statusObj = (statusObj == 1) ? 0 : 1;
	if (statusObj == 1) {
		ajax.send('pw_ajax.php?action=cmsreply&type=listreply','commentid='+commentid,function(){
			getObj('listreplys_'+commentid).innerHTML = ajax.runscript(ajax.request.responseText);
			getObj('getreplys_'+commentid).style.display = 'block';
		});
	} else {
		getObj('getreplys_'+commentid).style.display = 'none';
	}
}

function replycomment(username,form){
	form.content.value = '回复@'+username+' : ';
}

function delreply(replyid,commentid){
	ajax.send('pw_ajax.php?action=cmsreply&type=delreply','replyid='+replyid+'&commentid='+commentid,function(){
		var rText = ajax.request.responseText;
		if (rText=='success') {
			var commentnum = getObj('commentnum_'+commentid);
			if(commentnum){
				var regExp = /\(([0-9]+)\)/;
				if(regExp.test(commentnum.innerHTML)){
					var num = RegExp.$1;
				}
				if(isNaN(num) || num<=0){
					str = '';
				}else{
					str = '('+(--num)+')';
				}
				commentnum.innerHTML = str;
			}
			delElement('reply_'+replyid);
		} else {
			ajax.guide();
		}
	});
}
</script>
				</div>
			</div>
		</div>
	</div>
	<div class="cms_sd">
		<!--<iframe width="270" height="260" frameborder="0" scrolling="no" marginheight="0" marginwidth="0" src="http://maps.google.ca/maps?f=q&amp;source=s_q&amp;hl=en&amp;geocode=&amp;q=42+Brahms+Avenue,+Toronto,+Ontario&amp;aq=0&amp;sll=49.894634,-97.119141&amp;sspn=30.510813,79.013672&amp;vpsrc=0&amp;ie=UTF8&amp;hq=&amp;hnear=42+Brahms+Ave,+Toronto,+Toronto+Division,+Ontario+M2H+1G9&amp;t=m&amp;z=14&amp;ll=43.795333,-79.359636&amp;output=embed"></iframe><br /><small><a href="http://maps.google.ca/maps?f=q&amp;source=embed&amp;hl=en&amp;geocode=&amp;q=42+Brahms+Avenue,+Toronto,+Ontario&amp;aq=0&amp;sll=49.894634,-97.119141&amp;sspn=30.510813,79.013672&amp;vpsrc=0&amp;ie=UTF8&amp;hq=&amp;hnear=42+Brahms+Ave,+Toronto,+Toronto+Division,+Ontario+M2H+1G9&amp;t=m&amp;z=14&amp;ll=43.795333,-79.359636" style="color:#0000FF;text-align:left">View Larger Map</a></small>-->
          <div id="map_canvas" style="width:270;height:260px;position:relative"></div>
          <form id="map_search">
          	<input type="text" value="Enter Your Address Here" id="end"/>
            <div onclick="calcRoute();" style="cursor:pointer">Get Direction</div>
          </form>
          <script type="text/javascript">
			initialize();
		  </script>
	</div>
</div>
<script type="text/javascript" src="$pwModeJs/cms.js" ></script>
<script type="text/javascript">
var images = getObj('cmsContent').getElementsByTagName('img');
var imgLoader = setTimeout(imgLoad,200);
function imgLoad(){
	var l = images.length,maxWidth=550,n=false;
	for(var i = 0; i < l; i++){
		if(images[i].width > maxWidth){
			images[i].width = maxWidth;
		}
		if(images[i].width == 0){
			n=true;
		}
		if(n){
			imgLoader = setTimeout(imgLoad, 200);
		}
	}
}
window.onReady(function(){
	//控制多媒体播放
	var videos=getElementsByClassName("video");
	for(var i=0,len=videos.length;i<len;i++){
(function(elem){
toggleVideo(elem);
})(videos[i])
	}
});
</script>
{$fastpost}
<!--
EOT;
$fastpost && require_once PrintEot($fastpost);
?>-->